<?php
namespace addon\cms\validate;
use app\common\validate\ValidateBase;
class CustomForm extends ValidateBase
{
    // 验证规则
    protected $rule = [
        'name'                  => 'require|unique:CustomForm',
        'table'                 => 'require|unique:CustomForm',
        'sign'                  => 'require|unique:CustomForm'
    ];

    // 验证提示
    protected $message = [
        'name.require'         => '表单名称必须',
        'name.unique'          => '表单名已存在',
        'table.require'        => '表名必须',
        'table.unique'         => '数据表已存在',
        'sign.require'         => '表单标识必须',
        'sign.unique'          => '表单标识已存在',
    ];

    // 应用场景
    protected $scene = [
        'add'  =>  ['name','table','sign'],
        'edit'  =>  ['name','sign'],
    ];
}